package com.aaa.a1103.demo05;

import java.util.function.Function;

/**
 * @author 荆豪峰
 * @version 1.0
 */
public class Test07 {
    //这种函数式接口需要参数和有返回值。 Funcation<T,R> 函数型函数式接口
    public static void main(String[] args) {
        Function<String,Integer> f= t->t.length();

        fun(f,"hhhhhhh");

    }
    public static void fun(Function<String,Integer> f,String str){
        Integer apply = f.apply(str);
        System.out.println(apply);
    }
}
